-
Notifications
You must be signed in to change notification settings - Fork 3.9k
docs(client): fix incorrect comment about timeout calculation. #2252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ic or functional changes.
thanks for reporting, the current comment is indeed correct but I think this fix is wrong as well? I think instead it should be this? # Reduce the calculated timeout by a random range between 0-25% |
It seems good to me! I have revised the same for unity, referring to the same functionality code in openai-node repo, but I think the method you suggested is much reasonable. So I revised the comment as you suggested. |
Changes being requested
Existing annotations misrepresent code behavior; therefore, changed it to comment that correctly describes code behavior.
Additional context & links
AS-IS
openai-python/src/openai/_base_client.py
Lines 706 to 709 in f66d2e6
jitter
is a number in the range (0.75, 1] and is multiplied onsleep_secounds
. Therefore, the description "Apply some jitter, plus-or-minus half a second." is incorrect.Code Fix
vsComment Fix
By referring to the same functionality code in openai-node repo, we can infer that multiplying the
jitter
bysleep_second
is the intended behavior, so I decided to revise comment.